import { instance as request } from '../request'

/**
 * 获取分享给好友的项目详情
 * @param frinedId
 * @returns
 */
export const getShareProjectDetailApi = (
  frinedId: string
): PromiseRes<getShareProjectDetailItf[]> =>
  request.get(`/share/shareFriend/${frinedId}`)

/**
 * 为好友添加分享项目
 * @param data
 * @returns
 */
export const addShareProjectApi = (data: addShareProjectItf): PromiseRes =>
  request.post('/share/add', data)

/**
 * 删除分享的项目
 * @param data
 * @returns
 */
export const deleteShareProjectApi = (
  data: deleteShareProjectItf
): PromiseRes => request.put('/share/delete', data)

/**
 * 获取好友分享给我的项目列表
 * @param frinedId 好友id
 * @returns
 */
export const getFriendShareListDetailApi = (
  frinedId: string
): PromiseRes<getFriendShareDetailItf[]> =>
  request.get(`/share/friendShare/${frinedId}`)

/**
 * 获取好友分享给自己的项目详情，包含收获，示例，笔记详情
 * @param projectId 项目id
 * @returns
 */
export const getFriendProjectDetailApi = (
  projectId: string
): PromiseRes<getFriendProjectDetailItf> =>
  request.get(`/share/friendProject/${projectId}`)
